package com.sinosoft.controller;

import com.sinosoft.domain.news.NewsListConditions;
import com.sinosoft.pojo.NewsList;
import com.sinosoft.service.NewsListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author hyy85
 * @version 1.0
 * @date: 19/6/2018 上午 10:10<br/>
 * @description 新闻列表接口
 * @since 1.8
 */
@RestController
public class NewsListController {

    private final NewsListService newsListService;

    @Autowired
    public NewsListController(NewsListService newsListService) {
        this.newsListService = newsListService;
    }

    @PostMapping(value = "getNewsList")
    public List<NewsList> getAllNews(@RequestBody NewsListConditions conditions) {
        return newsListService.getAllNewsList(conditions);
    }

}
